# vlc
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

VER=2.2.4
URL=http://download.videolan.org/vlc/${VER}
PKG=vlc
COMP=tar.xz
DESC="VLC is a portable multimedia player, encoder, and streamer supporting many audio and video codecs"
DEPS=+qt,+libbluray
CAT=Multimedia
DESKTOP=vlc.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

patch_ () {
	for i in *.diff;do
		(cd ${PKG}-${VER};patch -p0 --verbose < ../${i})
	done
	(cd ${PKG}-${VER};autoreconf -f)
}

build_() {
	(
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--libdir=/usr/${LIBDIR} \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--enable-run-as-root \
				--disable-lua || exit
	make || exit
	make DESTDIR=${CWD}/${PKG}-install install
	)
	mkdir -p ${PKG}-install/usr/share/pixmaps/
	cp -a vlc.png ${PKG}-install/usr/share/pixmaps/
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
patch_
sleep 2
build_
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
